﻿using Domain.Model;
using System;
using System.Collections.Generic;
using System.Text;

namespace DTO
{
    public class WalletDetailsOutput
    {
        /// <summary>
        /// 类型
        /// </summary>
        public string BizType { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        public int Money { get; set; }
        /// <summary>
        /// 税
        /// </summary>
        public int Tax { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime CT { get; set; }

        public static IList<WalletDetailsOutput> Parse(List<InComeWalletLogAggregate> pageList)
        {
            List<WalletDetailsOutput> walletDetailsOutputs = new List<WalletDetailsOutput>();
            foreach (var item in pageList)
            {
                WalletDetailsOutput walletDetailsOutput = new WalletDetailsOutput();

                walletDetailsOutput.BizType = item.BizType;
                walletDetailsOutput.Title = item.BizDesc;
                walletDetailsOutput.Money = item.ChangeMoney;
                walletDetailsOutput.Tax = item.Tax;
                walletDetailsOutput.CT = item.CT;

                walletDetailsOutputs.Add(walletDetailsOutput);
            }
            return walletDetailsOutputs;
        }

        public static IList<WalletDetailsOutput> Parse(List<ChargeWalletLogAggregate> pageList)
        {
            List<WalletDetailsOutput> walletDetailsOutputs = new List<WalletDetailsOutput>();
            foreach (var item in pageList)
            {
                WalletDetailsOutput walletDetailsOutput = new WalletDetailsOutput();

                walletDetailsOutput.BizType = item.BizType;
                walletDetailsOutput.Title = item.BizDesc;
                walletDetailsOutput.Money = item.ChangeMoney;
                walletDetailsOutput.Tax = 0;
                walletDetailsOutput.CT = item.CT;

                walletDetailsOutputs.Add(walletDetailsOutput);
            }
            return walletDetailsOutputs;
        }
    }
}
